package com.mxx.common.netty.exception;

import io.netty.channel.ChannelHandlerContext;
import lombok.extern.slf4j.Slf4j;

/**
 * @Auther: Mr. Zeng
 * @Date: 2020/7/17 17:32
 * @Description: websocket异常处理默认实现类
 */
@Slf4j
public class ExceptionCatcherByWebsocketImpl implements ExceptionCatcherByWebsocket {
    public void exception(ChannelHandlerContext ctx, Throwable cause) throws Exception {
        log.error("netty Websocket Handler execute exception：", cause);
        ctx.channel().newFailedFuture(cause);
    }
}
